package online.foxnull2.foxmall.order.web;

import online.foxnull2.foxmall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class PayWebController {

    private final OrderService orderService;

    @Autowired
    public PayWebController(OrderService orderService) {
        this.orderService = orderService;
    }

    @ResponseBody
    @RequestMapping(value = "/pay", produces = "text/html")
    public String pay(@RequestParam("orderSn") String orderSn) {
        return orderService.pay(orderSn);
    }
}
